/**
 订单计算
 */
$(function(){
    //订单计算
    var $total = $('#price-text');
    var $unitPrice = $('.unit-price');
    var $unitPriceText = 0;
    var $a = 0;
    $unitPrice.each(function () {
        var nowUnitPriceText = $(this).html().substring(1,4);
        var $input = $(this).siblings('input[type="checkbox"]');
        $input.change(function () {
            if($(this).is(':checked')){
                $unitPriceText = nowUnitPriceText;
                $a += parseInt($unitPriceText);
                $total.html($a+'.00')
            }else {
                $a -= $(this).siblings('span').html().substring(1,4);
                $total.html($a+'.00')
            };
        });
    });
})
